package com.easpeed.elevator.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Created by bigyu on 2024/10/17 20:25
 * com.easpeed.elevator.bean
 */
public class LineBean implements Parcelable {


    private String lineName;
    private String lineId;


    private boolean expand;

    public LineBean() {

    }

    public boolean isExpand() {
        return expand;
    }

    public void setExpand(boolean expand) {
        this.expand = expand;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LineBean lineBean = (LineBean) o;
        return Objects.equals(lineName, lineBean.lineName);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(lineId);
    }

    private List<OpticalBean> opticalList = new ArrayList<>();

    public LineBean(String lineName, String lineId) {
        this.lineName = lineName;
        this.lineId = lineId;
    }

    protected LineBean(Parcel in) {
        lineName = in.readString();
        lineId = in.readString();
        opticalList = in.createTypedArrayList(OpticalBean.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(lineName);
        dest.writeString(lineId);
        dest.writeTypedList(opticalList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<LineBean> CREATOR = new Creator<LineBean>() {
        @Override
        public LineBean createFromParcel(Parcel in) {
            return new LineBean(in);
        }

        @Override
        public LineBean[] newArray(int size) {
            return new LineBean[size];
        }
    };

    public String getLineName() {
        return lineName;
    }

    public void setLineName(String lineName) {
        this.lineName = lineName;
    }

    public List<OpticalBean> getOpticalList() {
        return opticalList;
    }

    public void setOpticalList(List<OpticalBean> opticalList) {
        this.opticalList = opticalList;
    }

    public String getLineId() {
        return lineId;
    }

    public void setLineId(String lineId) {
        this.lineId = lineId;
    }
}
